loginDialog: Don't reconnect on each reset with gdmClient
When resetting the greeter proxy, it's destroyed and then recreated
again.
This destroy/recreate thing doesn't give any info to GDM and the greeter
interface destroyed has the same state as the newly created one.
Each time get_greeter_sync is called when greeter is destroyed makes GDM
create a new connection which stores in a list. This means that for each
reset a new unnecessary connection is created and stored.
GDM was leaking some objects which combined with this excessive connection
creation was causing a fd leak on each reset.
To make better use of resources and avoid problems, use ensure instead
of reset greeter proxy.
Florian Müllner [Tue, 10 Jun 2025 11:59:12 +0000 (13:59 +0200)]
ci: Run eslint-doc job unconditionally
The job is meant to run when either the style guide or the eslint
configuration changes. That stopped working when the style guide
was renamed to docs/js-coding-style.md without updating the job
conditions, whoops.
The job isn't very expensive to run, so just run it unconditionally
to avoid these kinds of oversights in the future.
Florian Müllner [Tue, 10 Jun 2025 11:43:12 +0000 (13:43 +0200)]
ci: Set variables at job level where possible
Variables that are defined at the global level are more disconnected
from the jobs that use them, and therefore more likely to get outdated
when the job changes.
To litigate that, define variables locally with the job unless they
are used by multiple jobs.
Turns out my AT&T Internet gateway acts as a captive portal for about
two minutes after it is started. It's wrong to assume captive portal
indicates Wi-Fi.
Also, change the terminology from "Sign Into" to "Sign In to" to be
pedantic. "Sign Into" seems to be pretty widely used on the web, so
maybe users won't notice, but "Into" is supposed to be a preposition,
not a verb.
Sebastian Wick [Fri, 16 May 2025 15:24:48 +0000 (17:24 +0200)]
status/brightness: Port to new MetaBacklight API
Mutter has taken over controlling the backlights of the system from
gnome-settings-daemon. It now exposes MetaMonitors which can be reached
from MetaMonitorManager, and any of the MetaMonitors can have a
controllable backlight.
For now, we keep the current UX and simply set the backlight percentage
of the primary monitor's backlight (or the first monitor's backlight, if
the primary monitor doesn't have a backlight) on all monitors.
g-s-d is still responsible for reacting to keyboard shortcuts and
popping up the OSD notification, but that might change in the future.
The UI may change to make it possible to control individual backlights
in the future.
Florian Müllner [Thu, 5 Jun 2025 13:33:16 +0000 (15:33 +0200)]
timeLimitsManager: Pass extra transition options as params
Boolean parameters are often harder to grasp, in particular when
there are multiple. So before adding more optional flags to
`_addTransition()`, pass flags as a params object.
Jordan Petridis [Tue, 3 Jun 2025 00:36:41 +0000 (03:36 +0300)]
ci: Update citemplates component version
The image we use now has a non-root user as well.
Gitlab happily defaults to it, but for the time being we
still need to run as root until we fix all the issues.
This was fixed in the template [1] and we need to update
the ref to include the change.
Carlos Garnacho [Sat, 31 May 2025 11:24:33 +0000 (13:24 +0200)]
keyboard: Add purpose hint getter to KeyboardController
This is the interface between the Keyboard widgetry and the input
method, add a getter so we can ask for the current purpose hint,
and initialize it from the current IM state in the constructor so
we can query it right away.
Florian Müllner [Tue, 27 May 2025 12:50:20 +0000 (14:50 +0200)]
tools/toolbox: Use devkit when integrating with GNOME Builder
Also support the new devkit when running from Builder. Unlike for
the run-gnome-shell script, we cannot easily support both --devkit
and --nested (without adding some wrapper), so drop the latter.
It should be fairly uncommon to use Builder to develop against
older branches, so hopefully this shouldn't be a limitation in
practice.
Adrian Vovk [Tue, 27 May 2025 21:03:34 +0000 (17:03 -0400)]
main: Notify gnome-session when we're ready
Basically, we recently[1] removed XSMP from gnome-session because it's
been disabled for a while. Mutter also[2] removed its XSMP integration
shortly after.
However, it turns out that gnome-session's builtin service manager was
relying on Mutter's XSMP integration to know when gnome-shell is done
starting up. No more XSMP = no more notification = gnome-session decides
that gnome-shell is dead even though it's not = fail whale
This is a temporary measure. GDM will soon switch[3] to an architecture
that will allow us to completely drop gnome-session's builtin service
manager, and this workaround will go away
Florian Müllner [Mon, 26 May 2025 12:08:31 +0000 (14:08 +0200)]
swipeTracker: Check all modifiers for modifier-scroll
It is possible that more than one modifiers is configured as
"button modifier". While mutter should only let through
scroll events when all modifiers are present, it doesn't hurt
to check for it on the gnome-shell side as well.
Alynx Zhou [Fri, 9 May 2025 04:16:52 +0000 (12:16 +0800)]
status/network: Fix VPN toggle not working when clicking the switch
VPN activation is triggered by clicking/touching the item, however,
the switch is reactive and blocks clicking/touching event so item won't
be activated. Manually activate item when switch is toggled to fix that.
Florian Müllner [Fri, 23 May 2025 20:15:13 +0000 (22:15 +0200)]
extensionSystem: Catch errors when removing extension update
We want to remove the temporary folder independently from whether the
update succeeded or failed, so we currently remove it from a `finally`
statement. Unfortunately that operation can fail as well, in which
case we don't catch it and the exception interferes with startup.
Fix this by removing the folder in a separate catch statement instead.
Florian Müllner [Fri, 23 May 2025 20:34:14 +0000 (22:34 +0200)]
fileUtils: Handle symlinks when moving/deleting dirs
We can handle them like regular files for the operations in question,
but we have to do so explicitly. Otherwise the link will not be
moved or removed, and in the latter case prevent the parent
directory from being removed as well (as it ends up non-empty).
Florian Müllner [Fri, 23 May 2025 22:19:53 +0000 (00:19 +0200)]
test: Don't append test env variables
If the specified variable already exists in the environment, append()
will append the value instead of overriding it. This isn't what we
want for the existing use case ("TZ=Europe/Madrid:UTC"), nor for
the case we are about to add.
Florian Müllner [Fri, 23 May 2025 22:30:16 +0000 (00:30 +0200)]
fileUtils: Don't collect files as `dir`
The method collects the children of subdirectories, regardless of
the children's file types.
It is therefore odd to return files as `dir`, in particular as the
method is indeed used to collect plain files (session modes and
search providers) as well as directories (installed extensions and
extension updates).
Change the returned objects to return files as `file`, which
works for both regular files and directories.
Philipp Kiemle [Wed, 21 May 2025 11:19:36 +0000 (13:19 +0200)]
breakManager: Add l10n comments
Small strings like this often have different possible translations,
depending on their meaning. A comment is needed here to make sure
they are translated correctly.
Florian Müllner [Wed, 21 May 2025 13:42:14 +0000 (15:42 +0200)]
environment: Remove old object.actor compatibility code
The change from plain JS classes with an actor property to
Clutter.Actor subclasses happened over 6 years ago, so
everyone should have adjusted by now.
Damien Tournoud [Tue, 13 May 2025 15:29:59 +0000 (08:29 -0700)]
appDisplay: Clicking outside folders does not consistently close them
This is because the container of the dialog changes sizes after a
refresh, for reasons that are not fully explained. A better condition
is to check explicitly that the click doesn't fall into the dialog.
Mutter now exposes the is_maximized() method for checking for
full maximization, and the plain (un)maximize() methods no
longer cover partial maximization.
Sebastian Keller [Wed, 30 Apr 2025 11:13:41 +0000 (13:13 +0200)]
timeLimitsManager: Don't adjust times for offset changes after resume
The non-continuous change in wall clock time after a suspend/resume
triggers timeChangeNotify which adjusts the stored time data according
to the difference in clock offsets. The monotonic clock however might
not have advanced during the suspend. Since the offsets are the
difference between the wall clock time and monotonic time, the
difference between the old and new offset will be the duration of the
sleep if there was no change in the monotonic clock. Adjusting the time
data by this will move the beginning of the inactive period from the
suspend forward in time to just before the resume, effectively removing
it. Since all previous times are adjusted as well, this will result in
time data as if the system had been running continuously, but was
started later than it actually was.
Fix this by not adjusting times on resume and just updating the current
offset to account for the monotonic clock not advancing during sleep.
Balló György [Mon, 31 Mar 2025 15:12:36 +0000 (17:12 +0200)]
runDialog: Fix launching shell command in terminal
At one point Clutter became stricter when handling keybindings,
and the text's `activate` signal is no longer emitted when
additional modifiers are pressed.
To fix launching a command in the terminal when activating
with ctrl, make the entry non-activatable and move activation
to a `key-press-event` handler.
Takao Fujiwara [Sun, 9 Mar 2025 00:40:36 +0000 (09:40 +0900)]
inputMethod: Check for surrounding text before enabling that capability
While the text input protocol does not have the concept of optional features,
some clients like VTE may lag behind on support for retrieving surrounding
text. This is seen as no surrounding text being set by the client, yet we
invariably enable the SURROUNDING_TEXT capability, giving some IMs the wrong
idea that no text is what there is, thus being free to submit other related
requests like deleting surroundings.
Optionally toggle the SURROUNDING_TEXT capability given the existence of
surrounding text, so that IMs know what to expect on subpar clients. At
a minimum, the surrounding text should be actually the empty string for
empty text fields, on clients that do support it.
Fixes: mutter@27bdf0c577 ("wayland/text-input: Use byte based offset in delete_surrounding_text") Fixes: mutter@33088d59db ("wayland/text-input: Pass char based offset to ClutterInputFocus") Fixes: mutter@fb86d5d5b0 ("wayland/text-input: Reset surrounding text values by focus change")
closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/3102
Andy Holmes [Tue, 18 Mar 2025 09:12:06 +0000 (02:12 -0700)]
messageList: Mark NotificationMessageGroup for export
This allows extensions to override `_addNotification()` to create
custom `NotificationMessage` subclasses, which is already possible
for `MessageTray.MessageTray._showNotification()`.
Optional catch bindings have been supported for quite a while now,
so we can treat unused error bindings in catch statements like any
other unused variable.
Florian Müllner [Thu, 13 Feb 2025 13:11:04 +0000 (14:11 +0100)]
loginDialog: Show session menu button when in IN_PROGRESS status
Commit c8bb45b added a new IN_PROGRESS status that replaces FAILED
while the user is still allowed to retry authentication.
We need to account for it when updating the visibility of the
session menu button, otherwise the button disappears after
entering a wrong password.
Fixes: c8bb45b41c ("gdm: Limit verification cancellations to be conform to allowed-failures") Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/5784
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3638>
Philip Withnall [Tue, 8 Apr 2025 14:32:36 +0000 (15:32 +0100)]
breakManager: Rework notification urgency setting and presentation
Move the setting of the notification’s urgency, and adding the
notification to the queue, to beside where the notification is created.
This avoids the potential for changing the urgency of an existing
notification if none of the branches above are taken, and
`this._notification` is non-empty.
Spotted by Florian Müllner in
https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3687#note_2405781.
Signed-off-by: Philip Withnall <pwithnall@gnome.org>
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3687>
Philip Withnall [Tue, 8 Apr 2025 14:28:46 +0000 (15:28 +0100)]
breakManager: Clarify some nextBreakType variables
This doesn’t introduce any functional changes, as
`this._manager.currentBreakType` is set to the value returned by
`this._manager.getNextBreakDue()` when entering `BreakState.BREAK_DUE`.
However, it should make the code a little clearer as now the code refers
to the ’next’ break type rather than the ‘current’ one in the context of
an upcoming break.
Signed-off-by: Philip Withnall <pwithnall@gnome.org>
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3687>
Philip Withnall [Wed, 2 Apr 2025 11:32:40 +0000 (12:32 +0100)]
breakManager: Update manager state after settings change
The change of settings may have affected when a break is due. In
particular, `this._breakLastEnd` is modified in `_updateSettings()`,
but `this._state` is not modified correspondingly to transition to/from
a `BREAK_DUE` state (if appropriate).
This could be the cause of the `breakDueAgo should be non-negative`
assertion failure from #8280.
Signed-off-by: Philip Withnall <pwithnall@gnome.org> Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/8280
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3687>
Philip Withnall [Wed, 2 Apr 2025 11:06:42 +0000 (12:06 +0100)]
breakManager: Make brightness setting function clearer
Confusingly, the `brightness` property of
`ClutterBrightnessContrastEffect` has type `CoglColor`, but the
`set_brightness()` setter takes a single `float`.
We previously chose to use the property setter everywhere for
consistency (see
https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3655#note_2369353),
but didn’t realise the types don’t match.
GJS optimises `this._brightnessEffect.brightness = foo` into a call to
`clutter_brightness_contrast_effect_set_brightness()`, which means the
type mismatch between the two results in a warning (see
https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/8280).
So, let’s change from a property setter into an explicit method call to
avoid the type ambiguity, at the expense of a bit of clarity from using
the same method to set the initial value and each property animation
step.
Signed-off-by: Philip Withnall <pwithnall@gnome.org>
Helps: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/8280
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3687>
Philip Withnall [Wed, 2 Apr 2025 11:05:43 +0000 (12:05 +0100)]
breakManager: Fix a potential null object dereference
There’s no `else` branch above, so it’s possible for
`this._notification` to be `null` at the bottom of the function
(especially if the user has explicitly closed the previous
notification), so handle that.
Signed-off-by: Philip Withnall <pwithnall@gnome.org>
Helps: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/8280
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3687>
A type-safe comparision against null can be incorrectly positive with never initialized
variables (undefined).
As spotted in https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3688#note_2407551,
allowing for type coercion avoids this situation.
Jonas Dreßler [Wed, 26 Mar 2025 15:12:19 +0000 (16:12 +0100)]
st/image-content: Don't force preferred content size to texture size
When ClutterImage got merged into StImageContent with commit 64d5d01360
("st: Merge ClutterImage with ImageContent"), a small error slipped in when
copying over the update_image_size() function.
Within ClutterImage, update_image_size() served a simple purpose: To call
clutter_content_invalidate_size() in case the texture size would change.
To check that, ClutterImage was storing the existing texture size in the
priv->width and priv->height fields.
When merging into StImageContent, those priv->width/height fields happened
to overlap with priv->width/height of StImageContent, but there they are
storing the preferred size, rather than the texture size. Copying
update_image_size() as-is into StImageContent meant we now set the
preferred size to the texture size, subtly breaking resource-scaled StIcons
(where texture size is a multiple of the preferred size).
The breakage isn't very apparent because StIcons manually set the size
of their internal ClutterActor child to the requested icon-size via
clutter_actor_set_size() in st_texture_cache_load_gicon(), and that makes
the child actor report the correct size in get_preferred_width/height(). The
child actor gets allocated via clutter_actor_allocate_align_fill() from
ClutterBinLayouts vfunc_allocate(), and clutter_actor_allocate_align_fill()
honors both the available size from the parent and the CONTENT_SIZE
request-mode on the child. So when the StIcon has a larger allocation (aka
extra available size), clutter_actor_allocate_align_fill() will fill that
available space with the (too large) content size.
To reproduce the issue, on a resource-scaled monitor, simply create an
StIcon with a fixed width and height that's larger than the icon-size. The
icon will be painted too large and blurry.
Fix this fallout by avoiding to touch the priv->width/height properties on
StImageContent, and instead simply comparing old texture size to new texture
size, we have both textures around after all!
Sebastian Keller [Wed, 26 Mar 2025 10:28:30 +0000 (11:28 +0100)]
loginManager: Use signal argument to detect preparing for sleep
The DBus PreparingForSleep property on org.freedesktop.login1.Manager
does not trigger PropertyChanged signals, leading to wrong values due to
gdbus caching. In most cases it would have always been false.
Additionally it was not included in the XML interface description file
included in gnome-shell. So it was actually undefined.
Since this property is used in _calculateUserStateFromLogind() to
determine that a user is not active when closing the lid on a laptop,
the user was considered still active.
Fix this by storing the "start" argument from the PrepareForSleep signal
instead of trying to read from the property.
Fixes: 6a43b6f55 ("timeLimitsManager: Store screen time state on suspend/resume") Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/8185
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3679>
Sebastian Keller [Sun, 23 Feb 2025 11:15:52 +0000 (12:15 +0100)]
slider: Align handle size with with pixel grid
Since the handle radius is used to calculate the width and height of the
slider, having the calculated size be a non-integer value can cause the
following widgets in a box-like container to be unaligned with the pixel
grid, which can lead to blurriness or other visual issues.
This for example could be observed with the interface font set to
"Cantarell 12", which results in a handle radius of 8.278. In quick
settings when showing two consecutive sliders, the second slider then
gets rendered at a non-integer vertical offset.
Further having a non-integer size for a StDrawingArea can cause the
texture to get slightly squished or stretched as the size of the cairo
surface is rounded to the nearest pixel, but rendered using the
unrounded actor size.
This commit changes the border radius rather than ceiling the preferred
width/height so that the handle size always matches the width or height
of the widget and there are no visual gaps caused by a partially filled
pixel.
Sebastian Keller [Thu, 20 Feb 2025 22:31:05 +0000 (23:31 +0100)]
slider: Use correct handle size when calculating rightmost position
Using the ceiled radius for calculating the rightmost position the
handle can take on the slider was resulting in a small gap when the size
was not an integer value since the radius used when drawing the handle
is not ceiled.
This effectively reverts 38da479e which seems to have been the wrong fix
for the problem it was trying to solve. The problem presumably had been
caused by not considering the border that the handle still had at that
time.
The border issue was then later fixed by 3ddae9d8, without reverting 38da479e. Then in 6fd0aac8 support for drawing borders on the slider got
dropped, including the changes from 3ddae9d8, leaving us with just the
changes from 38da479e but now without borders on the handle.